home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / CmdLine / src / CmdOpt_double.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  708b  |  40 lines

  1. #include "CmdLine.h"
  2.  
  3. #include <RJS/Convert.h>
  4.  
  5. RJS_CmdOpt_double::RJS_CmdOpt_double(const char *k, RJS_CmdOpt::CmdOptFlags f) : 
  6.     RJS_CmdOpt(k,RJS_CmdOpt::CmdOptFlags(f| Value)) 
  7.     val=0; 
  8.  
  9. RJS_CmdOpt_double::RJS_CmdOpt_double(const char *k, const RJS_String &dv, 
  10.                 RJS_CmdOpt::CmdOptFlags f) : 
  11.     RJS_CmdOpt(k,dv,f)
  12.     val=0; 
  13.  
  14. void RJS_CmdOpt_double::reset() 
  15. {
  16.     RJS_CmdOpt::reset();
  17.     val=0;
  18. }
  19.  
  20.  int RJS_CmdOpt_double::set_value() 
  21. {
  22.     val=RJS_Convert::toDouble(RJS_CmdOpt::val);
  23.     if (RJS_Convert::ok()) return 1; else return 0;
  24. }
  25.  
  26. const char *RJS_CmdOpt_double::value_type()
  27. {
  28.     return "double";
  29. }
  30.  
  31. void RJS_CmdOpt_double::dump()
  32. {
  33.     RJS_CmdOpt::dump();
  34.     cout << "double: " << value() << endl;
  35. }
  36.